home *** CD-ROM | disk | FTP | other *** search
- Path: news-sop.inria.fr!usenet
- From: Herve Bernier <hbernier@sophia.inria.fr>
- Newsgroups: comp.lang.c
- Subject: Re: Heeelp: Interfacing Pascal object code with C. How?
- Date: Fri, 01 Mar 1996 08:15:12 +0100
- Organization: INRIA - Sophia Antipolis (France)
- Message-ID: <3136A400.15FB7483@sophia.inria.fr>
- References: <triant.825447166@pegasus.montclair.edu>
- NNTP-Posting-Host: rubis.inria.fr
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; SunOS 4.1.3_U1 sun4m)
-
- Hi from France
-
- Constantine Triantafillou wrote:
- >
- > Hi!
- >
- > I am doing a programming project, developing a very simple imaginery
- > assembler:
- >
- > However I have the following problem.
- >
- > I am trying to find out how can I interface an object file
- > with a C program. Note that the object file is generated
- > by a Pascal compiler ...
-
-
- I do that interface a few years ago, but i don't remember all about that
-
- If it could help you, the parameters are inverted between C and Pascal
- code
-
- For exemple
-
- Pascal : procedure Proc(a,b,c,d)
-
- C : Proc(d,c,b,a) or Proc_(d,c,b,a)
- To know that, parse your pascal object file to see how the
- procedure is defined. You also have to know that C compiler add
- an '_' at the beginning of a function, so if you see :
- _Proc -> it will be called Proc(...) by C program
- _Proc_ -> it will be called Proc_(...) by C program
-
- I don't remember neither about global/local variable (but i thing it's
- the same thing), nor about input/Output variables.
-
-
- Hope this will help you.
-
- I someone need help about interfacing C and Fortran, i know a lot about
- it
-
- Regards
-
- Herve Bernier
- Ingenieur Expert
- Projet SYSDYS - INRIA
- hbernier@sophia.inria.fr
-